<?php
require_once(MODX_BASE_PATH . 'assets/snippets/gCart/config.php');
require_once(MODX_BASE_PATH . 'assets/snippets/gCart/classes/ups.php');
require_once(MODX_BASE_PATH . 'assets/snippets/gCart/include/gDiscount.php');
require_once(MODX_BASE_PATH . 'assets/snippets/gCart/include/gCart.inc.php');

if(!isset($pID)) return 'You must set the pID parameter to use PayPal.';

$gParams  = array();
$gParams['gItemTpl'] = $modx->getChunk($gItemTpl);
$gParams['gCartTpl'] = $modx->getChunk($gCartTpl);
$gParams['gAjaxTpl'] = $modx->getChunk($gAjaxTpl);
$gParams['gEmptyTpl'] = $modx->getChunk($gEmptyTpl);

if(!$gTaxRate) $gTaxRate = '0.065';
if(!$gTaxShipping) $gTaxShipping = 'true';
if(!$gZipCode) $gZipCode = '62902';
if(!$gCity) $gCity = 'Carbondale';
if(!$gState) $gState = 'IL';
if(!$gShipID) $gShipID = 'Blue Sky';
if(!$upsHandling) $upsHandling = 0;

$gParams['pID'] = $pID;
$gParams['gKey'] = $gKey;
$gParams['gTaxRate'] = $gTaxRate;
$gParams['gTaxShipping'] = $gTaxShipping;
$gParams['gZipCode'] = $gZipCode;
$gParams['gCity'] = $gCity;
$gParams['gState'] = $gState;
$gParams['gShipID'] = $gShipID;
$gParams['upsHandling'] = $upsHandling

return getPayPal($gParams);
?>